package com.walterweimod.auxiliary_attributes.item;

import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import org.slf4j.Logger;

import static com.walterweimod.auxiliary_attributes.Auxiliary_attributes.*;

public class ModItemRegistry {
    public static final DeferredRegister<Item> ITEM = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);

    public static final RegistryObject<Item> MY_NEW_ITEM = ITEM.register("my_new_item", () -> new MyNewItem(new Item
            .Properties()
            .tab(CreativeModeTab.TAB_FOOD)
            .food(new FoodProperties
                    .Builder()
                    .nutrition(20)
                    .alwaysEat()
                    .effect(() -> new MobEffectInstance(MobEffects.ABSORPTION, 600, 99), 1.0f)
                    .build())));

    public static void register(IEventBus iEventBus, Logger logger) {
        ITEM.register(iEventBus);

        logger.info("Registering Item: {}", MY_NEW_ITEM.getId());
    }
}
